package com.gusti.common.util;

import java.util.GregorianCalendar;

public class DateUtil {

	public static GregorianCalendar getToday() {
		return truncateTime( getInstance() );
	}
	
	public static GregorianCalendar getInstance() {
		return new GregorianCalendar();
	}
	
	public static GregorianCalendar truncateTime( GregorianCalendar gregorianCalendar ) {
		GregorianCalendar calendar = getInstance();
		calendar.setTimeInMillis( gregorianCalendar.getTimeInMillis() );
		calendar.set( GregorianCalendar.HOUR_OF_DAY, 0 );
		calendar.set( GregorianCalendar.MINUTE, 0 );
		calendar.set( GregorianCalendar.SECOND, 0 );
		calendar.set( GregorianCalendar.MILLISECOND, 0 );
		return calendar;
	}
    
}
